/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kopsox.comm.listener;

import java.util.Collection;

import org.kopsox.comm.message.ValueMessage;

/**
 * Each Value which implements this interface, is observed by registered observers
 *
 * @author Konrad Renner
 *
 */
public interface Observed {

	/**
	 * Registers an Observer
	 * 
	 * @param observer
	 * @return boolean
	 */
	public boolean addObserver(final Observer observer);
	
	/**
	 * Registers an Observer
	 * 
	 * @param observer
	 * @return boolean
	 */
	public boolean addAllObservers(final Collection<Observer> observer);
	
	/**
	 * Removes an Observer
	 * 
	 * @param observer
	 * @return boolean
	 */
	public boolean removeObserver(final Observer observer);
	
	/**
	 * Gets all registered Observers
	 * 
	 * @return Collection<Observer>
	 */
	public Collection<Observer> getAllObservers();
	
	/**
	 * Notifies all registered Observers that there was an event
	 * @param message
	 */
	public void notifyObservers(ValueMessage message);
}
